//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.hustcad.plm.basic.log;

import com.hustcad.plm.basic.util.TyCommonExtUtil;
import com.ty.basic.i18n.I18nConfig;
import java.util.Locale;
import java.util.Objects;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.context.NoSuchMessageException;
import org.springframework.context.annotation.Primary;

@Primary
public enum LogEventEnum {
    LOGIN("LOGIN", "系统登入", true, 3),
    LOGOUT("LOGOUT", "注销", true, 3),
    RESET_PASSWORD("RESET_PASSWORD", "重置密码", true, 3),
    CRATE_OBJECT("CRATE_OBJECT", "新建对象", true, 3),
    CHANGE_LC_STATE("CHANGE_LC_STATE", "event.new.change.lifecycle.state", true, 3),
    CHECK_IN("CHECK_IN", "event.check.in", true, 3),
    CHECK_OUT("CHECK_OUT", "检出", true, 3),
    UPDATE_OBJECT("UPDATE_OBJECT", "编辑属性", true, 3),
    UPDATE_IDENTIFIER("UPDATE_IDENTIFIER", "编辑标识", true, 3),
    UPDATE_CONTENT("UPDATE_CONTENT", "编辑内容", true, 3),
    UPDATE_PRODUCT_STRUCT("UPDATE_PRODUCT_STRUCT", "修改产品结构", true, 3),
    COMMENT_AND_NOTE("COMMENT_AND_NOTE", "批注和注释", true, 3),
    MOVE_OBJECT("MOVE_OBJECT", "event.move.object", true, 3),
    CREATE_VERSION("CREATE_VERSION", "新建视图版本", true, 3),
    REVISE("REVISE", "event.new.revision", true, 3),
    UNDO_CHECK_OUT("UNDO_CHECK_OUT", "撤销检出", true, 3),
    ADD_TO_WORKSPACE("ADD_TO_WORKSPACE", "添加到工作区", true, 3),
    SAVE_AS("SAVE_AS", "另存", true, 3),
    DOWNLOAD("DOWNLOAD", "输出", true, 3),
    UPLOAD("UPLOAD", "上传", true, 3),
    IMPORT("IMPORT", "导入", true, 3),
    EXPORT("EXPORT", "导出", true, 3),
    ADD_TO_WORKFLOW("ADD_TO_WORKFLOW", "添加到流程", true, 3),
    ADD_TO_EC("ADD_TO_EC", "添加到变更", true, 3),
    MPM_DERIVE("MPM_DERIVE", "派生", true, 3),
    MPM_BOOK("MPM_BOOK", "工艺成册", true, 3),
    UPDATE_OBJECTOWNEROID("UPDATE_OBJECTOWNEROID", "设置所有者", true, 3),
    DELETE_OBJECT("DELETE_OBJECT", "event.delete.object", true, 3),
    ADD_TO_ISSUE("ADD_TO_ISSUE", "添加到问题报告", true, 3),
    VIEW_OBJECT("VIEW_OBJECT", "访问对象", true, 3),
    LOG_QUERY("LOG_QUERY", "日志查询", true, 3),
    QUERY_LIST("QUERY_LIST", "查询集合", true, 3),
    LOG_EXPORT("LOG_EXPORT", "日志导出", true, 3),
    ADD_TO_RISK("ADD_TO_RISK", "添加到风险", true, 3),
    ENABLE("ENABLE", "启用", true, 3),
    DISABLE("DISABLE", "停用", true, 3),
    HIDE("HIDE", "隐藏", true, 3),
    SHOW("SHOW", "显示", true, 3),
    ENABLEORDISABLE("ENABLEORDISABLE", "启停用", true, 3),
    MENUACCESS("MENUACCESS", "菜单授权", true, 3),
    PASS("PASS", "通过", true, 3),
    LIGHTWEIGHT("LIGHTWEIGHT", "轻量化", true, 3),
    PUBLISH("PUBLISH", "发布", true, 3),
    IGNORE_JOB("IGNORE_JOB", "忽略受影响任务", true, 3),
    ADD("ADD", "添加", true, 3),
    RECEIVE("RECEIVE", "接收", true, 3),
    ROLLBACK("ROLLBACK", "退回", true, 3),
    REMOVE("REMOVE", "移除", true, 3),
    CHANGE_AUTO_COMPLETED("CHANGE_AUTO_COMPLETED", "变更单自动完成", true, 3),
    PAUSE("PAUSE", "暂停", true, 3),
    TERMINATE("TERMINATE", "终止", true, 3),
    ADJUST("ADJUST", "调整", true, 3),
    SUBMIT("SUBMIT", "提交", true, 3),
    INITIATE_CHANGE("INITIATE_CHANGE", "发起变更", true, 3),
    TAKE_BACK("TAKE_BACK", "收回", true, 3),
    COMPLETED("COMPLETED", "完成", true, 3),
    AUTOMATIC_RECEPTION("AUTOMATIC_RECEPTION", "自动接收", true, 3),
    RESTART("RESTART", "恢复启动", true, 3),
    TURN_DOWN("TURN_DOWN", "驳回", true, 3),
    AGREE("AGREE", "同意", true, 3),
    RELEASE("RELEASE", "下达", true, 3),
    UNLOCK("UNLOCK", "解锁", true, 3),
    LOCK("LOCK", "锁定", true, 3),
    TRANS("TRANS", "转交", true, 3),
    WAIT("WAIT", "等待", true, 3),
    WORKOUT("WORKOUT", "编制中", true, 3),
    NOTRELEASED("NOTRELEASED", "未下达", true, 3),
    POSTAUDIT("POSTAUDIT", "后置审核", true, 3),
    NORMAL("NORMAL", "正常", true, 3),
    OVERDUE("OVERDUE", "逾期", true, 3),
    LATECOMPLETION("LATECOMPLETION", "逾期完成", true, 3),
    UNPUBLISHED("UNPUBLISHED", "未发布", true, 3),
    GETDOCLIST("GETDOCLIST", "获取文档列表", true, 3),
    DOWNLOADFILE("DOWNLOAD_FILE", "下载文件", true, 3);

    private String key;
    private String label;
    private boolean enable;
    private int auditGroup;

    private LogEventEnum(String key, String name, boolean enable, int auditGroup) {
        this.key = key;
        this.label = name;
        this.enable = enable;
        this.auditGroup = auditGroup;
    }

    public String getLabel() {
        String language = TyCommonExtUtil.getFrontLanguage();
        Locale locale = !Objects.equals(language, "en-US") && !Objects.equals(language, "en") ? Locale.SIMPLIFIED_CHINESE : Locale.US;

        try {
            return I18nConfig.getMessageSourceAccessor().getMessage(this.label, locale);
        } catch (NoSuchMessageException var4) {
            return this.label;
        }
    }

    public String getKey() {
        return this.key;
    }

    public boolean isEnable() {
        return this.enable;
    }

    public int getAuditGroup() {
        return this.auditGroup;
    }

    public boolean equalsValue(String label) {
        if (ObjectUtils.isEmpty(label)) {
            return false;
        } else {
            try {
                LogEventEnum logEventEnum = valueOf(label);
                return this.equals(logEventEnum);
            } catch (IllegalArgumentException var3) {
                return false;
            }
        }
    }

    public static LogEventEnum getLogEventLabelEnum(String label) {
        try {
            return valueOf(label);
        } catch (IllegalArgumentException var2) {
            return null;
        }
    }
}
